home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / tools / czesc_2 / ixg06d / docs / ixclient_2.rexx < prev    next >
OS/2 REXX Batch file  |  1982-07-25  |  2KB  |  111 lines

  1. /* Sample arexx client program for iX-Guide */
  2. /* Miscellaneous graphics routines */
  3.  
  4. if show('p',"IXCL_2") then exit
  5.  
  6. if ~show('l', "rexxsupport.library") then
  7.     addlib('rexxsupport.library',0,-30,0)
  8.  
  9. OPTIONS RESULTS
  10.  
  11. ADDRESS IXGUIDE
  12. ADDCLIENT
  13. portname='IXCL_2'
  14. call openport(portname)
  15. setport portname MISC
  16. AllocRaster 3
  17. if rc ~= 0 then exit
  18. rp=result
  19. Refresh rp
  20. SetABPen rp 1 0
  21. OpenFont 'times.font' 24; f1 = result
  22. OpenFont 'times.font' 18; f2 = result
  23. OpenFont 'topaz.font' 8; f3 = result
  24.  
  25. call LoadImage()
  26.  
  27. call GraphDemo()
  28.  
  29. shutdown=0
  30.  
  31. do until shutdown
  32.  call waitpkt(portname)
  33.  msg = getpkt(portname)
  34.  
  35.  if msg ~= '0000 0000'x then do
  36.   cmd = getarg(msg)
  37.   
  38.   if cmd='MISC' then do
  39.    a4=getarg(msg,1)
  40.    
  41.    if a4='QUIT' then
  42.     shutdown=1
  43.    
  44.    if a4='NEWSCREEN' then do
  45.     /* we need to reload picture */
  46.     DisposePicture pobj
  47.     call LoadImage()
  48.     call GraphDemo()
  49.     end
  50.   
  51.   end
  52.  
  53.   call reply(msg,0)
  54.  end
  55. end
  56.  
  57. DisposePicture pobj
  58. CloseFont f1;CloseFont f2;CloseFont f3
  59. FreeRaster rp
  60. RemClient
  61. call closeport(portname)
  62. exit
  63.  
  64. LoadImage:
  65.  NewPicture 'images/mainback.iff' 
  66.  if rc ~= 0 then do
  67.   say 'Cannot load mainback.iff !'
  68.   CloseFont f1;CloseFont f2;CloseFont f3
  69.   FreeRaster rp
  70.   RemClient
  71.   call closeport(portname)
  72.  exit
  73.  end
  74.  pobj = result
  75.  
  76.  GetBitMap pobj; bm = result
  77.  PWidth pobj; w = result
  78.  PHeight pobj; h = result
  79.  BltBitMapRP bm 0 0 rp 5 5 w h 192
  80.  
  81. return 0
  82.  
  83. GraphDemo:
  84.  SetDrMd rp 0
  85.  SetFont rp f1
  86.  Move rp 5 25
  87.  Text rp '"iX-Guide arexx graphics"'
  88.  Move rp 55 50
  89.  SetFont rp f2
  90.  SetDrMd rp 1
  91.  SetABPen rp 0 1
  92.  Text rp '"You can have different"'
  93.  Move rp 55 70
  94.  Text rp '"fonts, colors, styles..."'
  95.  SoftStyle rp 1
  96.  SetFont rp f3
  97.  SetABPen rp 1
  98.  SetDrMd rp 0
  99.  Move rp 10 90
  100.  Text rp '"bold "';SoftStyle rp 2;Text rp '"underlined "';
  101.  SoftStyle rp 4;Text rp 'italic'; 
  102.  SoftStyle rp 0
  103.  Move rp 30 100
  104.  Text rp '"You can load datatype pictures"'
  105.  Move rp 30 110
  106.  Text rp '"like picture in this rectangle"'
  107.  
  108.  DrawEllipse rp 150 70 30 30 
  109.  
  110. return 0
  111.